package UnitTestClasses;



import java.util.ArrayList;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import ModelLayer.*;
import DBLayer.*;

public class EventDBTest {
	
	EventDB dbe = new EventDB();

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testGetAllEvents() {
		ArrayList<Event> ev = dbe.getAllEvents(false);
		for(Event event:ev)
		{
			System.out.println("Event name: "+event.getName()+" PriceType: "+event.getPriceType());
		}
	}

	@Test
	public void testFindEvent() {
			Event ev = dbe.findEvent(2, false);
			System.out.println(ev.getName());
	}

	@Test
	public void testSearchEventName() {
		ArrayList<Event> ev = dbe.searchEventName("Ladies",false);
		for(Event event:ev)
		{
			System.out.println("Event name: "+event.getName()+" PriceType: "+event.getPriceType());
		}
	}

/*	@Test
	public void testInsertEvent() throws Exception {
		Event evObj = new Event("JUnit Test", "01/01/1970", "16", "20", "Unit test", "Staff");
		dbe.insertEvent(evObj);
	}*/

/*	@Test
	public void testUpdateEvent() {
		Event evObj = new Event(14,"JUnit Test update", "01/01/1970", "16", "20", "Unit test", "Staff");
		dbe.updateEvent(evObj);
	}*/

/*	@Test
	public void testDeleteEvent() {
		ArrayList<Event> ev = dbe.getAllEvents(false);
		System.out.println(ev.size());
		dbe.deleteEvent(14);
		ArrayList<Event> ev2 = dbe.getAllEvents(false);
		System.out.println(ev2.size());
	}
*/
}
